package net.sf.filelink;

import net.sf.filelink.hover.FileResourceHover;

import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.sse.core.text.IStructuredPartitions;
import org.eclipse.wst.xml.core.text.IXMLPartitions;
import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;

public class FileLinkTextViewerConfiguration extends
		StructuredTextViewerConfigurationXML {

	@Override
	public ITextHover getTextHover(ISourceViewer sourceViewer,
			String contentType, int stateMask) {
		if ((contentType == IStructuredPartitions.DEFAULT_PARTITION)
				|| (contentType == IXMLPartitions.XML_DEFAULT)) {
			return new FileResourceHover(sourceViewer);
		}
		return super.getTextHover(sourceViewer, contentType, stateMask);
	}
}
